using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Windows.Data;
using BingleMaps.Models;

namespace BingleMaps.Converters
{
	public class ItineraryDictionaryConverter : IValueConverter
	{
		public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
		{
			if (value is IEnumerable<ItineraryItem>)
			{
				UInt16 count = 1;
				return ((IEnumerable<ItineraryItem>)value).ToDictionary(i => count++);
			}
			return null;
		}

		public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
		{
			throw new NotSupportedException();
		}
	}
}